<?php
/**
 *Template Name: Helpdesk template
 */
get_header();
get_template_part( 'slider2' );
?>
<script type="text/javascript"><!--//--><![CDATA[//><!--
function submit_access_key(){
	var sk = document.getElementById('access_key_pretty').value;
	if (sk == '') return;
	var url = 'http://support.pharmatv.dk/confirm_access_key.ns?access_key_pretty=' + sk + '&popup=1';
	var popW = 400;
	var popH = 160;
	var wdwpos = ',width=' + popW + ',height=' + popH;
	if (document.all || document.layers) 
		wdwpos = wdwpos + ',top=' + (screen.availHeight-popH)/2 + ',left=' + (screen.availWidth-popW)/2;
	var nw = window.open(url,'','toolbar=no,directories=no,status=no,menubar=no,resizable=yes,location=no,scrollbars=no' + wdwpos);
	nw.opener = self;
	document.getElementById('access_key_pretty').value = '';
	return false;
}
//--><!]]></script>
<script type="text/javascript"><!--//--><![CDATA[//><!--
function issues_validate() {
	var id = document.getElementById('issues:id');
	if (id == undefined || id == null) { 
		return true;
	}
	var index = id.selectedIndex;
	if (index == 0) {
		alert("Please select your issue!");
		return false;
	}

	return true;
}
//--><!]]></script>
	<div class="content">
		<div class="template clear-fix" id="casestudy">
			<div class="heading clear-fix">
				<h2>Helpdesk</h2>
			</div>
			<div class="tpl-full clear-fix" id="helpdesk-wrapper">
				<p id="helpdesk-intro">
					<?php
						$my_id = 165;
						$post = get_post($my_id); 
						echo $post->post_content
					?>
				</p>
				<div class="eachHelpdesk-wrapper">
					<div class="eachHelpdesk">
						<form action="http://support.pharmatv.dk/confirm_access_key.ns" method="get">
							<div class="eachHelpdesk-header clear-fix">
								<h3>Session Key</h3>
								<a title="lorem" class="btnQuestion">Question</a>
							</div>
							<div class="eachHelpdesk-body-1 clear-fix">
								<input type="text" name="access_key_pretty" id="access_key_pretty" onkeypress="if(event.keyCode==13 || event.which==13) { document.getElementById('access_key_submit').click(); return false; }"/>
								<a id="btnSubmit-sessionkey" class="btnSubmit" onclick="document.getElementById('access_key_submit').click(); return false;">Submit</a>
								<input type="submit" name="access_key_submit" id="access_key_submit" value="Submit" onclick="return submit_access_key();" style="display: none;" />
							</div>						
						</form>				
					</div>
					<div class="eachHelpdesk">
						<form name="issues_menu" action="http://support.pharmatv.dk/download_customer_connector.ns" method="post" onsubmit="return issues_validate();" id="issues_form">
							<div class="eachHelpdesk-header clear-fix">
								<h3>Issue Submission</h3>
								<a class="btnQuestion">Question</a>
							</div>
							<div class="eachHelpdesk-body-2 clear-fix">
								<div class="eachHelpdesk-row clear-fix">
									<label for="Your issue">Your issue</label>
									<select id="issues:id" name="id" >
										<option value="">- Please choose an issue -</option>										
										<option label="Other Issue" value="">Other Issue</option>
									</select>									
								</div>
								<div class="eachHelpdesk-row clear-fix">
									<label for="Your name">Your name</label>
									<input type="text" name="customer_name" value="" id="issues:customer_name" />
								</div>
								<div class="eachHelpdesk-row clear-fix">
									<label for="Company name">Company name</label>
									<input type="text" name="customer_company" value="" id="issues:customer_company" />
								</div>
								<div class="eachHelpdesk-row clear-fix">
									<label for="Describle your issue" name="customer_desc" id="issues:customer_desc">Describle your issue</label>
									<textarea></textarea>
								</div>
								<a id="btnSubmit-issue" class="btnSubmit" onclick="document.getElementById('issues:submit').click(); return false;">Submit</a>
								<input id="issues:submit" name="submit" type="submit" value="Submit" style="display: none;"/>
							</div>
							<input type="hidden" name="issue_menu" id="issues:issue_menu" value="1" />							
						</form>
						<div class="clear"></div>
					</div>
				</div>
				<img src="<?php echo get_template_directory_uri(); ?>/src/images/imgQuestion.png" alt="Question Helpdesk" id="question-temp" />
			</div>			
		</div>
	</div>
<?php get_footer(); ?>
